<?php $view->extend('forum/forum_template', 'content', array('title' => $view->lang->get('forum')->get('forums'))); ?>

<div class="forums">

<div class="col c12">
	<div class="row">
		<div class="col c6">
			<h2><?php echo $view->lang->get('forum')->get('forum')?></h2>
		</div>
		<div class="col c2">
			<h2><?php echo $view->lang->get('forum')->get('posts')?></h2>
		</div>
		<div class="col c4">
			<h2><?php echo $view->lang->get('forum')->get('last_post')?></h2>
		</div>
	</div>	
</div>
<?php foreach($forums as $forum):?>
<div class="col c12">
	<div class="row">
		<div class="col c6">
			<a href="<?php echo $view->url->linkTo('Forum','forumShow', array('page' => 0, 'title'=>$forum->getUrl()))?>"><h4><?php echo $forum->getTitle()?></h4></a>
			<p><?php echo $forum->getDescription()?></p>
		</div>
		<div class="col c2">
			<p>
			<?php echo $view->lang->get('forum')->get('threads')?>: <?php echo $forum->getThreadCount();?><br />
			<?php echo $view->lang->get('forum')->get('posts')?>: <?php echo $forum->getPostCount();?><br />
			</p>
		</div>
		<div class="col c4">
			<?php $lt = $forum->getLastThread(); /* $li = Get the first thread*/?>
			<?php if ($lt): ?>
			<?php $fp = $lt->getFirstPost(); /* $fp = First post get */?>
			<a href="<?php echo $view->url->linkTo('Forum','thread', array('title'=>$forum->getUrl(), 'id' => $lt->getID(),'page' => 0 ))?>"><h4><?php echo $lt->getTitle()?></h4></a>
			<p>
			by <?php echo $fp->getUsername()?><br />
			<?php echo $fp->getPostedSince()?> ago
			</p>
			<?php endif;?>
		</div>
	</div>
</div>
<?php endforeach;?>

</div>